<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Check for installed modules</title>
<style type="text/css">
.good {
	color: green;
	font-weight: bold;
}
.bad {
	color: red;
	font-weight: bold;
}
</style>
</head>
<body>

<?php

// PHP version >= 5
echo 'PHP version >= 5: ';
$v = explode('.', PHP_VERSION );
if ( $v[0] >= 5 )
{
	echo '<span class="good">OK</span>';
}
else
{
	echo '<span class="bad">NO!</span> version found: ' . PHP_VERSION;
	echo '<br/><br/><span class="bad">Please install PHP version >= 5</span>';
	exit;
}
echo '<br/>';

// php imap
echo 'IMAP module for PHP: ';
$v = function_exists('imap_open');
if ( $v == true )
{
	echo '<span class="good">OK</span>';
}
else
{
	echo '<span class="bad">NO!</span>';
	echo '<br/><br/><span class="bad">Please install the IMAP module for PHP (sudo apt-get install php5-imap).</span>';
	exit;
}
echo '<br/>';

// php mcrypt
echo 'Mcrypt module for PHP: ';
$v = function_exists('mcrypt_generic_init');
if ( $v == true )
{
	echo '<span class="good">OK</span>';
}
else
{
	echo '<span class="bad">NO!</span>';
	echo '<br/><br/><span class="bad">Please install the Mcrypt module for PHP.</span>';
	exit;
}
echo '<br/>';


// done
echo '<br/><br/><span class="good">Done! All the needed modules are installed.</span>';

?>

</body>
</html>
